package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class twoteams extends AppCompatActivity {
    private int ScoreA=0;
    private int ScoreB=0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_twoteams);
    }
    public void clickA(View Btn1){
        if(Btn1.getId()==R.id.button11){
            TextView scoreText = findViewById(R.id.scoreA);
            int s1 = Integer.parseInt(scoreText.getText().toString());
            scoreText.setText(String.valueOf(s1+3));
        }
        else if(Btn1.getId()==R.id.button12){
            TextView scoreText = findViewById(R.id.scoreA);
            int s1 = Integer.parseInt(scoreText.getText().toString());
            scoreText.setText(String.valueOf(s1+2));
        }
        else if(Btn1.getId()==R.id.button14){
            TextView scoreText = findViewById(R.id.scoreA);
            int s1 = Integer.parseInt(scoreText.getText().toString());
            scoreText.setText(String.valueOf(s1+0));
        }
    }
    public void clickB(View Btn2){
        if(Btn2.getId()==R.id.button17){
            TextView scoreText = findViewById(R.id.scoreB);
            int s2 = Integer.parseInt(scoreText.getText().toString());
            scoreText.setText(String.valueOf(s2+3));
        }
        else if(Btn2.getId()==R.id.button16){
            TextView scoreText = findViewById(R.id.scoreB);
            int s2 = Integer.parseInt(scoreText.getText().toString());
            scoreText.setText(String.valueOf(s2+2));
        }
        else if(Btn2.getId()==R.id.button15){
            TextView scoreText = findViewById(R.id.scoreB);
            int s2 = Integer.parseInt(scoreText.getText().toString());
            scoreText.setText(String.valueOf(s2+0));
        }
    }

}